<extend name="Public:base" />
<!-- 网站标题 -->
<block name="title">得分管理</block>
<block name="appendheader"> 
	<!-- 删除确认插件 --> 
	<script type="text/javascript" src="__PUBLIC__/artDialog/jquery.artDialog.js?skin=default"></script> 
	<script type="text/javascript" src="__PUBLIC__/artDialog/iframeTools.js"></script> 
	<script type="text/javascript" src="__PUBLIC__/common/js/list.js"></script> 
	<script type="text/javascript">
		$(function() {
			$("#WebMenu-3000").addClass('active');	//选中父菜单
			$("#WebMenu-3020").addClass('active');	//选中当前菜单
		});
		
		//下载问卷数据
		function download(data_type) {
			var type = $("#type").val();
			var area_code = $("#area_code").val();
			var school = $("#school").val();
			if(data_type == 'all' || data_type == 'seq' || data_type == 'score' || data_type == 'spss' || data_type == 'score_seq') {
				if(type == '') {
					art.dialog.alert("没有选择用户类型！");
					return;
				}
				if(area_code == '') {
					art.dialog.alert("没有选择县区！");
					return;
				}
			}
			if(data_type == 'all') {   // 提交数据+得分
				window.open('__APP__?g=Admin&m=Score&a=download_bat&type=' + type + '&area_code=' + area_code + '&school=' + school, '问卷详细数据下载（提交数据+得分）', '');	
			} else if(data_type == 'seq') { 
				window.open('__APP__?g=Admin&m=Score&a=download_bat_seq&type=' + type + '&area_code=' + area_code + '&school=' + school, '问卷详细数据下载（提交数据序号）', '');	
			} else if(data_type == 'spss') { 
				window.open('__APP__?g=Admin&m=Score&a=download_spss&type=' + type + '&area_code=' + area_code + '&school=' + school, '问卷详细数据下载（SPSS分析）', '');	
			} else if(data_type == 'spss_select') { 
				window.open('__APP__?g=Admin&m=Score&a=download_spss_select&type=' + type + '&area_code=' + area_code + '&school=' + school, '问卷详细数据下载（SPSS分析 select only）', '');
			} else if(data_type == 'score') {  //问卷项目得分，具体指标项，按题项代码
				window.open('__APP__?g=Admin&m=Score&a=download_bat_score&type=' + type +  '&area_code=' + area_code + '&school=' + school, '问卷项目得分数据下载（仅得分）', '');
			} else if(data_type == 'score_seq') {  //问卷项目得分，具体指标项，按题项序号
				window.open('__APP__?g=Admin&m=Score&a=download_bat_score_seq&type=' + type + '&area_code=' + area_code + '&school=' + school, '问卷项目得分数据下载（仅得分，按题项序号）', '');
			} else if(data_type == 'third_quota') {  //问卷详细数据（指标项得分）
				window.open('__APP__?g=Admin&m=Score&a=download_third_quota&type=' + type + '&area_code=' + area_code + '&school=' + school, '问卷详细数据（三级指标项得分）下载', '');
			} else if(data_type == 'second_quota') {  //问卷详细数据（个体二级阶段得分）
				window.open('__APP__?g=Admin&m=Score&a=download_second_quota&type=' + type + '&area_code=' + area_code + '&school=' + school, '问卷详细数据（二级指标项得分）下载', '');
			} else if(data_type == 'first_quota') {  //问卷详细数据（个体一级阶段得分）
				window.open('__APP__?g=Admin&m=Score&a=download_first_quota&type=' + type + '&area_code=' + area_code + '&school=' + school, '问卷详细数据（一级指标项得分）下载', '');
			} else if(data_type == 'num') {  //问卷详细数据（频数统计）
				window.open('__APP__?g=Admin&m=Score&a=download_score_num&type=' + type + '&area_code=' + area_code + '&school=' + school, '问卷详细数据（频数统计）下载', '');
			}
		}
		//重置密码
		function reset_pwd(userid) {  
			var custom_data;
			art.dialog.confirm('密码将重置为“666666"，确定要重置吗？', function() {
				$.ajax({
			        type:"POST",
			        dataType:'json',
			        url:'?g=Admin&m=Groups_user&a=reset_pwd',
			        data:{userid:userid},
			        success:function(data){
			        	
			        	if(data.status == '1') {
			        		art.dialog({
				        	    icon: 'succeed',
				        	    content: data.info,
				        	    time:2
				        	});
			        		//location.reload(true);
			        		//custom_data=data.data;
				        	//$('#test').load(custom_data.url);
			        	} else {
			        		art.dialog({
				        	    icon: 'error',
				        	    content: data.info,
				        	    time:2
				        	});
			        	}
			        },
			        error:function(data){
			        	art.dialog({
			        	    icon: 'error',
			        	    content: '重置密码失败！！！',
			        	    time:2
			        	});
			        }
			    });
		    });
		};
		//改变检索条件时提交表单
		function submit_form() {
			$("#searchForm").submit();
		}
	</script> 
</block>
</block>
<!-- 当前位置 -->
<block name="breadcrumb">
	<div class="page-header pull-left">
		<div class="page-title">得分管理</div>
	</div>
	<ol class="breadcrumb page-breadcrumb pull-left">
		<li><i class="fa fa-home"></i>&nbsp;<a href="__APP__?g=Admin">首页</a>&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
		<li><a href="#">数据管理</a>&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
		<li class="active">得分管理</li>
	</ol>
</block>
<!-- 网页主内容区 -->
<block name="main_content">
	<div class="row">
		<div class="col-md-12">
			<div class="portlet box">
				<div class="portlet-body">
					<div class="row mbm">
						<div class="col-md-12">
							<a href="__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a=generate_questionid" class="btn btn-success"><i class="fa fa-arrow-right"></i>&nbsp;生成选项编号</a>&nbsp;
							<a href="__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a=generate_question_type" class="btn btn-success"><i class="fa fa-arrow-right"></i>&nbsp;生成题项类型</a>&nbsp;
							<a href="__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a=generate_question_score" class="btn btn-success"><i class="fa fa-arrow-right"></i>&nbsp;生成题项得分</a>&nbsp;
							<a href="__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a=generate_score_question_seq" class="btn btn-success"><i class="fa fa-arrow-right"></i>&nbsp;生成score表question_seq</a>&nbsp;
							<a href="__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a=generate_score_item_seq" class="btn btn-success"><i class="fa fa-arrow-right"></i>&nbsp;生成score表item_seq</a>&nbsp;
							<a href="__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a=generate_score_user_quota" class="btn btn-success"><i class="fa fa-arrow-right"></i>&nbsp;生成用户-指标项得分</a>&nbsp;
						</div>
					</div>
					<div class="row mbm">
						<div class="col-md-12">
							<form id="searchForm" name="searchForm" action="__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a={:ACTION_NAME}" method="post">
								<div class="col-sm-9 col-md-9">
									<div class="row">
										<div class="col-sm-2 padding-0">
											<select id="province_code" name="province_code" class="form-control" style="width:100%;" onChange="submit_form()">
												<option value="">-全部省份-</option>
												<volist name="province_list" id="vo">
													<option value="{$vo.code}" <eq name="Think.request.province_code" value="$vo.code">selected</eq> >{$vo.name}</option>
												</volist>
											</select>
										</div>
										<div class="col-sm-2 padding-0">
											<select id="city_code" name="city_code" class="form-control" onChange="submit_form()">
												<option value="">-全部市州-</option>
												<volist name="city_list" id="vo">
													<option value="{$vo.code}" <eq name="Think.request.city_code" value="$vo.code">selected</eq> >{$vo.name}</option>
												</volist>
											</select>
										</div>
										<div class="col-sm-2 padding-0">
											<select id="area_code" name="area_code" class="form-control" onChange="submit_form()">
												<option value="">-全部县区-</option>
												<volist name="area_list" id="vo">
													<option value="{$vo.code}" <eq name="Think.request.area_code" value="$vo.code">selected</eq> >{$vo.name}</option>
												</volist>
											</select>
										</div>
										<div class="col-sm-2 padding-0">
											<select id="school" name="school" class="form-control" onChange="submit_form()">
												<option value="">-全部学校-</option>
												<volist name="school_list" id="vo">
													<option value="{$vo.id}" <eq name="Think.request.school" value="$vo.id">selected</eq> >{$vo.name}</option>
												</volist>
											</select>
										</div>
										<div class="col-sm-2 padding-0">
											<select id="type" name="type" class="form-control" onChange="submit_form()">
												<option value="">-全部用户-</option>
												<volist name="type_list" id="vo">
													<option value="{$vo.id}" <eq name="Think.request.type" value="$vo.id">selected</eq> >{$vo.name}</option>
												</volist>
											</select>
										</div>
										<!-- <div class="col-sm-2 padding-0">
											<a type="button" href="javascript:download()" class="btn btn-green mbs"><i class="fa fa-download"></i>&nbsp;下载问卷数据</a>
											<div class="btn-group">
												<button type="button" data-toggle="dropdown" class="btn btn-green dropdown-toggle mbs"><i class="fa fa-download"></i>下载问卷数据 &nbsp;
													<span class="caret"></span>
												</button>
												<ul role="menu" class="dropdown-menu">
													<li><a type="button" href="javascript:download('all')"><i class="fa fa-download"></i>&nbsp;问卷详细数据（提交数据+得分）</a></li>
													<li><a type="button" href="javascript:download('seq')"><i class="fa fa-download"></i>&nbsp;问卷详细数据（提交选项序号）</a></li>
													<li><a type="button" href="javascript:download('spss')"><i class="fa fa-download"></i>&nbsp;问卷详细数据（SPSS分析）</a></li>
													<li><a type="button" href="javascript:download('spss_select')"><i class="fa fa-download"></i>&nbsp;问卷详细数据（SPSS分析_select_only）</a></li>
													<li><a type="button" href="javascript:download('score')"><i class="fa fa-download"></i>&nbsp;问卷详细数据（问卷项目得分_按题项代码）</a></li>
													<li><a type="button" href="javascript:download('score_seq')"><i class="fa fa-download"></i>&nbsp;问卷详细数据（问卷项目得分_按题项序号）</a></li>
													<li><a type="button" href="javascript:download('third_quota')"><i class="fa fa-download"></i>&nbsp;问卷详细数据（三级指标项得分）</a></li>
													<li><a type="button" href="javascript:download('second_quota')"><i class="fa fa-download"></i>&nbsp;问卷详细数据（二级指标项得分）</a></li>
													<li><a type="button" href="javascript:download('first_quota')"><i class="fa fa-download"></i>&nbsp;问卷详细数据（一级指标项得分）</a></li>
													<li><a type="button" href="javascript:download('num')"><i class="fa fa-download"></i>&nbsp;问卷详细数据（频数统计）</a></li>
												</ul>
				                           	</div>
										</div>
										-->
									</div>
								</div>
								<div class="col-md-3 padding-0"> 
									<div class="dataTables_filter" id="table_id_filter">
										<label>
											<div class="input-group">
												<input type="hidden" name="groupsid" value="{$Think.request.groupsid}"/>
												<input type="search" value="{$Think.request.search_keyword}" name="search_keyword" placeholder="请输入关键字检索" class="form-control" />
												<span class="input-group-btn">
													<input type="submit" class="btn btn-success" value="查询" />
												</span>
											</div>
										</label>
									</div>
								</div>
							</form>
						</div>
					</div>
					<form id="myform" name="myform" action="__APP__?g=Admin&m=GroupsUser&a=delete&groupsid={$groupsid}" method="post" >
						<table class="table table-hover table-striped table-bordered table-advanced tablesorter tb-sticky-header">
							<thead>
								<tr>
									<th width="10"><input type="checkbox" class="checkall" /></th>
									<th width="80">姓名</th>
									<th width="150">所属地域</th>
									<th width="100">所在学校</th>
									<th width="100">提交题目数量</th>
									<th width="100">提交信息数量</th>
									<th width="80">开始时间</th>
									<th width="80">结束时间</th>
									<th width="80">所用时间</th>
									<th width="40">得分</th>
									<th width="40">总分</th>
									<th width="40">问卷反馈</th>
								    <th width="180">操作</th>
								</tr>
							</thead>
							<tbody>
								<volist name="data" id="vo">
									<tr>
										<td><input type="checkbox" id="ids" name="ids[{$i}]" value="{$vo.id}" /></td>
										<td>{$vo.real_name}</td>
										<td>{$vo.area_code}<br/>{$vo.area_name}</td>
										<td>{$vo.school}</td>
										<td>{$vo.item_num}</td>
										<td>{$vo.value_num}</td>
										<td>{$vo.begin_time}</td>
										<td>{$vo.end_time}</td>
										<td>{$vo.used_time}</td>
										<td>{$vo.score}</td>
										<td>{$vo.total_score}</td>
										<td>{$vo.feedback}{$vo.types}</td>
										<td>
	                                        <div class="btn-group">
												<button type="button" data-toggle="dropdown" class="btn btn-green dropdown-toggle btn-xs mbs">操作 &nbsp;
	                                                <span class="caret"></span>
	                                            </button>
                                                <ul role="menu" class="dropdown-menu">
	                                                <li><a type="button" href="javascript:reset_pwd('{$vo.id}');"><i class="fa fa-edit"></i>&nbsp;重置密码</a></li>
	                                                <!-- <li><a type="button" href="javascript:art_confirm('您确定要清楚该用户的提交问卷数据吗？清除后将不可恢复！','__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a=clear_item_value&id={$vo.id}&groupsid={$groupsid}');"><i class="fa fa-magic"></i>&nbsp;清除问卷数据</a></li>
<!--	                                                <li class="divider"></li>-->
	                                            </ul>
	                                       	</div>
	                                       	<if condition="$vo.types eq 'b'">
                                            	<a href="__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a=scan_ztdf&id={$vo.id}" target = "_blank" class="btn btn-success  btn-xs mbs"><i class="fa fa-plus"></i>&nbsp;得分分析</a>&nbsp;
                                            	<a href="__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a=scan_dffx&id={$vo.id}" class="btn btn-success  btn-xs mbs"><i class="fa fa-plus"></i>&nbsp;得分分析2</a>&nbsp;
                                            </if>
<!--											<a type="button" href="__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a=edit&id={$vo.id}&groupsid={$groupsid}" class="btn btn-blue btn-xs mbs"><i class="fa fa-edit"></i>&nbsp;编辑</a>&nbsp;-->
<!--											<a type="button" href="javascript:confirm_delete('ids[{$i}]')" class="btn btn-danger btn-xs mbs"><i class="fa fa-trash-o"></i>&nbsp;删除</a> -->
										</td>
									</tr>
								</volist>
							</tbody>
						</table>
					</form>
					<!-- 显示分页信息 --> 
					{$show}
				</div>
			</div>
		</div>
	</div>
</block>
